package com.decade.qiyeshapan.config;

public class RedisKeyManager {
    // 用户相关
    public static String userHash(String gameId) {
        return String.format("game:%s", gameId);
    }
    
    public static String userState(String gameId, String username) {
        return String.format("game:%s:user:%s", gameId, username);
    }

    // 游戏全局信息
    public static String gameInfo(String gameId) {
        return String.format("game:%s:info", gameId);
    }

    public static String gamePlayers(String gameId) {
        return String.format("game:%s:players", gameId);
    }

    public static String gameProgress(String gameId) {
        return String.format("game:%s:progress", gameId);
    }

    public static String globalProgress(String gameId) {
        return String.format("game:%s:globalProgress", gameId);
    }

    // 时间线
    public static String timeline(String gameId) {
        return String.format("game:%s:timeline", gameId);
    }

    // 订单相关
    public static String orderKey(String orderId) {
        return String.format("order:%s", orderId);
    }

    public static String userOrders(String gameId, String username) {
        return String.format("game:%s:user-orders:%s", gameId, username);
    }

    public static String gameTurn(String gameId) {
        return String.format("game:turn:%s", gameId);
    }

    // 广告相关
    public static String adRanking(String gameId, String region, String product) {
        return String.format("ad:%s:%s:%s", gameId, region, product);
    }

    public static String userAdTotal(String gameId, String username) {
        return String.format("adTotal:%s:%s", gameId, username);
    }
} 